<?php

namespace App\Http\Requests\Admin;


class MerchantDetailsRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'merchant_id' => [
                'required'
            ],
            'merchant_name' => [
                'required|unique:articles,merchant_name'
            ],
            'merchant_address' => [
                'required'
            ],
            'telephone' => [
                'required'
            ],
        ];
    }

    public function messages()
    {
        return [
            'merchant_id.required' => ' 请选择商户姓名',
            'merchant_name.required' => '请输入商户名称',
            'merchant_name.unique' => '商户名称不能重复',
            'merchant_address.required' => '请输入商户地址',
            'telephone.required' => '请输入客户电话',
        ];
    }
}
